package com.qef.com.mmovie.di.module;

import android.content.Context;

import com.qef.com.mmovie.App;
import com.qef.com.mmovie.api.ApiSever;
import com.qef.com.mmovie.api.DowLoadServer;
import com.qef.com.mmovie.api.LaughImgServer;
import com.qef.com.mmovie.api.TopVieddoServer;
import com.qef.com.mmovie.di.RetrofitHelper;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by guangjiego on 2017/3/21.
 */
@Module
public class AppModule {
    public final App mApp;

    public AppModule(App mApp) {
        this.mApp = mApp;
    }

    @Provides
    @Singleton
    Context providesContext() {
        return mApp;
    }

    @Provides
    ApiSever providesApiService(RetrofitHelper retrofitHelper) {
        return retrofitHelper.getApiSever();
    }

    @Provides
    TopVieddoServer providesTopVieddoServer(RetrofitHelper retrofitHelper) {
        return retrofitHelper.getTopVieddoServer();
    }

    @Provides
    LaughImgServer providesLaughImgServer(RetrofitHelper retrofitHelper) {
        return retrofitHelper.getLaughImgServer();
    }

    @Provides
    DowLoadServer providesDowloadServer(RetrofitHelper retrofitHelper) {
        return retrofitHelper.getDowLoadServer();
    }
}
